import Vue from 'vue'
import VueRouter from 'vue-router'

import Login from '../pages/login/MyIndex.vue'
import Register from '../pages/register/MyIndex.vue'
import Home from '../pages/home/MyIndex.vue'
import Classify from '../pages/classify/MyIndex.vue'
import Car from '../pages/car/MyIndex.vue'
import Mine from '../pages/mine/MyIndex.vue'
import MyTrade from '../pages/Trade/MyIndex.vue'
Vue.use(VueRouter);

const router = new VueRouter({
  // mode: 'history',
  // base: process.env.BASE_URL,
  routes: [{
    path: '/',
    redirect: 'home'
  },
  {
    path: '/login',
    component: Login,
    name: 'Login',
    //登陆页面不显示底部菜单
    meta: {
      showFooter: false,
    }
  },
  {
    path: '/register',
    component: Register,
    name: 'Register',
    meta: {
      showFooter: false,
    },
  },
  {
    path: '/home',
    component: Home,
    name: 'home',
    meta: {
      showFooter: true,
  },
  },
  //详情
  {
    path: "/detail",
    name: "Detail",
    component: () => import("../pages/detail/MyIndex.vue"),
    meta: {
      showFooter: false,
    },
  },
  // 分类
  {
    path: '/classify',
    component: Classify,
    name: 'classify',
    //登陆页面不显示底部菜单
    meta: {
      showFooter: true,
    },
  },
  //购物车
  {
    path: '/car',
    component: Car,
    name: 'car',
    meta: {
      showFooter: false,
    },
  },
  // 订单
  {
    path: '/trade',
    component: MyTrade,
    name: 'trade',
    meta: {
      showFooter: false,
    },
  },
  // 我的
  {
    path: '/mine',
    component: Mine,
    name: 'mine',
    meta: {
      showFooter: true,
    },
  },
  // 设置中心
  {
    path: '/set',
    component: () => import("../pages/set/MyIndex.vue"),
    name: 'set',
    meta: {
      showFooter: false,
    },
  }

  ],
  linkActiveClass: 'active'
})

export default router

